<#import "/WEB-INF/sys/js_css.html" as js>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>零度CMS</title>
</head>
<body class="easyui-layout">
	<!-- top框架 -->
	<div data-options="region:'north',border:true" style=" width: 100%; background: #F2F2F2; height: 60px; padding: 1px; overflow: hidden; position: relative;">
		<div style="padding-top:30px;padding-left:30px;width:100%;height:60px;background-image:url(${ctx}/image/top_bg_image.jpg)">
			<span style="font-size:30px;font-weight:bold; color:#666666">零度CMS</span>
		</div>
	</div>
	<!-- 菜单框架 -->
	<div data-options="region:'west'" style="width:200px;">
		<div class="easyui-accordion" data-options="fit:true,border:false">
			<div title="功能菜单" data-options="selected:true">
				<div class="zTreeDemoBackground left">
					<ul id="menuTree" class="ztree"></ul>
				</div>
			</div>
		</div>
	</div>
	<!-- 主页面 -->
	<div data-options="region:'center',title:'主页面'">
		<div id="systemTabs" class="easyui-tabs" data-options="fit:true,border:true">
          <div id="firstTab" title="首页" style="padding:10px;overflow:hidden;">
            <div style="margin-top:20px;">
					<h1>公告信息</h1>
				</div>
          </div>
        </div>  
	</div>
	<div data-options="region:'south'" style="height:20px;text-align:center">
		Copyright &#169;微盟科技
	</div>
</body>
<@js.easyui />
<@js.zTree />
<script type="text/javascript">
	jQuery(document).ready(function() {
		var setting = {
			data: {
				simpleData: {
					enable: true
				}
			},
			async: {
				enable: true,
				type:"post",
				url:"${ctx}/sys/menu/leftmenu"
			},
			callback:{onClick:zTreeOnClick}
		};
		jQuery.fn.zTree.init(jQuery("#menuTree"), setting);
	});
	//zTree添加tab页面
	function zTreeOnClick(event, treeId, treeNode) {
		treeNode.click = "return false;"
		var id = treeNode.id;
		var url = treeNode.hrefurl;
		if(url=="")
			return;
		var name = treeNode.name;
		if (treeNode.pid == 0) {
			return false;
		}
		qxTabAdd("tab_" + id, "iframe_" + id, name, url, true);
	};
	//添加tab
	function qxTabAdd(tabId, iframeId, tabTitle, tabHref, isCloseMenu) {
		var content = '<iframe  scrolling="yes"    id="' + iframeId
				+ '"  class="tabIframe" frameborder="0" src="' + tabHref
				+ '" style="width:100%;height:100%;"></iframe>';
		var systemTabs = jQuery('#systemTabs');
		var title = jQuery.trim(tabTitle);
		if (systemTabs.tabs('exists', title)) {
			systemTabs.tabs('select', title);
			return;
		}
		jQuery('#systemTabs').tabs('add', {
			id : "tabs_" + tabId,
			title : tabTitle,
			content : content,
			closable : true
		});
		if (isCloseMenu | false) {
			jQuery('#systemTabs').tabs('close', {
				forceClose : true
			});
		}
	};
	//关闭
	function qxTabClose() {
		var currTitle = jQuery('#systemTabs').tabs("getSelected").panel(
				'options').title;
		jQuery('#systemTabs').tabs('close', currTitle);
	}
</script>
</html>